package org.mullin.stratego.shared;

public class Piece {
	public Rank rank;
	public int color;
	public boolean shown;
	boolean known;
	
	public Piece(int color, Rank rank) {
		this.color = color;
		this.rank = rank;
		
		shown = known = false;
	}
	
	/**
	 * 
	 * @param shown
	 */
	public void setShown(boolean shown) {
		this.shown = shown;
	}
	
	@Override
	public boolean equals(Object rhs) {
		if (null == rhs) {
			return false;
		}
		
		if (!(rhs instanceof Piece)) {
			return false;
		}
		Piece other = (Piece)rhs;		
		return rank == other.rank && color == other.color;
	}
	
	@Override
	public String toString() {
		return rank.toString() + Color.toString(color);
	}
}
